package com.me.darkness_is_coming.actors;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.me.darkness_is_coming.actors.Cloud.CloudType;
import com.me.darkness_is_coming.screens.GameScreen;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class Food extends Actor
{
    public enum FoodType{APPLE,MUSHROOM};
    public enum FoodColor{RED,GREEN,VIOLET,RAINBOW,FROZEN};
    private TextureRegion texture;
    private Rectangle Colider;
    FoodType Type;
    FoodColor Color;

    public Food(TextureRegion texture,float X,float Y,float Width,float Height ,FoodType type, FoodColor color)
    {
        this.texture = texture;
        setSize(Width, Height);
        setPosition(X, Y);
        Type = type;
        Color = color;
        //Colider = new Rectangle(getX()-0.4f*getWidth(),getY(),getWidth()+0.8f*getWidth(),getHeight());
        Colider = new Rectangle(getX(),getY(),getWidth(),getHeight());

    }

    public Rectangle getColider()
    {
        return Colider;
    }
    public FoodType getFType() { return Type; }
    public FoodColor getFColor(){ return Color; }

    @Override
    public void act(float delta){
        Colider.setY(getY() - Gdx.graphics.getHeight() * GameScreen.CloudMushroomSpeed * delta / (Gdx.graphics.getHeight()*0.12f));
        setPosition( getX(), getY() - Gdx.graphics.getHeight() * GameScreen.CloudMushroomSpeed * delta / (Gdx.graphics.getHeight()*0.12f));
    }

	@Override
	public void draw(Batch batch, float parentAlpha)
	{
		batch.setColor(getColor());
		batch.draw(texture, getX(), getY(), getWidth(), getHeight());
	}
}